Developing data product - assignment week 3

The goal of the project is to create a web page presentation using R Markdown that features a plot created with Plotly, and to host the resulting web page on either GitHub Pages, RPubs, or NeoCities.

The plot presented in this assignment includes the homicide rates in Canada from years 1961 to 2017. Source: https://www150.statcan.gc.ca/t1/tbl1/en/tv.action?pid=3510006801 section “Download options”

rm(list=ls())
library(plotly)
## Warning: package 'plotly' was built under R version 3.5.2
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(data.table)
library(tidyr)
library(lubridate)
## 
## Attaching package: 'lubridate'
## The following objects are masked from 'package:data.table':
## 
##     hour, isoweek, mday, minute, month, quarter, second, wday,
##     week, yday, year
## The following object is masked from 'package:base':
## 
##     date
library(zoo)
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric

Data

homicides <- read.csv('./homicides.csv', header=T)
dim(homicides)
summary(homicides)
plot_ly(homicides) %>%
  add_trace(x = ~Year, y = ~Homicide.Rate, type="scatter", mode = "markers", 
            name = "slight", legendgroup = "slight", 
            marker = list(color = "#1A7A90")) %>%
  layout(
    title = "Homicide Rate in Canada",
    xaxis = list(title = "Year"),
    yaxis = list(title = "Homicide Rate, per 100000")
  )